package com.wufan.day07.java4;

/**
 * @author SongWufan
 * @date 2022/5/18 23:37
 */
public class PersonTest {
    public static void main(String[] args) {
        Person p1 = new Person();
        p1.eat();

        Man man = new Man();
        man.eat();
        man.age = 25;
        man.earnMoney();

        /**
         * 对象的多态性
         */
        Person p2 = new Man();

        Person p3 = new Woman();

        /**
         * 多态的使用
         */
        p2.eat();
        p2.walk();

        System.out.println(p2.id);


    }
}
